package com.auxgroup.smarthome.entity;

import org.apache.commons.lang3.RandomUtils;

import java.util.UUID;

/**
 * Created by kevinchen on 2017/8/12.
 * 定时控制任务实例
 * 这里仅仅是示例 一切以系统设计文档为案例
 */
public class UserDeviceDemoEntity {
    //用户id
    private String uid;
    //设备id
    private String did;
    //定时时间
    private int time;
    //触发什么控制指令
    private String events;

    public UserDeviceDemoEntity() {
        this.uid = UUID.randomUUID().toString();
        this.did = UUID.randomUUID().toString().substring(0,12);
        this.time = RandomUtils.nextInt((int)(System.currentTimeMillis()/1000l),Integer.MAX_VALUE);
        this.events = RandomUtils.nextInt(0,1) == 0 ? "TURN ON" : "TURN OFF";
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getDid() {
        return did;
    }

    public void setDid(String did) {
        this.did = did;
    }

    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public String getEvents() {
        return events;
    }

    public void setEvents(String events) {
        this.events = events;
    }
}
